package loop;

/**
 * @author:WIN10
 * @date:2022/1/15
 * @describe: 乘法口诀
 */
public class MultiplicationFormula {

    public static void main(String[] args) {
        //multiplication();
        //getWhile();
        getDoWhile();


    }

    /**
     * 乘法口诀
     */
    public static void multiplication() {
        for (int i = 1; i <= 9; i++) {

            for (int j = 1; j <= i; j++) {
                System.out.print(j + "*" + i + "=" + i * j + " ");
            }
            System.out.println();
        }
    }

    /**
     * while练习
     */
    public static void getWhile() {
        int num = 1;
        while (num <= 5) {
            num++;
            System.out.print("*");
        }
    }

    /**
     * do...while练习
     */
    public static void getDoWhile() {
        int num = 1;
        do {
            num++;
            System.out.print("*");
        }
        while (num <= 9);
    }
}
